home *** CD-ROM | disk | FTP | other *** search
/ Champak 119 / (Vol 119) Nov 09 2010.iso / TGKI-109 / Games / tobby_ura_ura.swf / scripts / DefineSprite_131 / frame_1 / DoAction.as
Text File  |  2010-11-09  |  1KB  |  76 lines

  1. function main()
  2. {
  3.    if(this.procNum == 1)
  4.    {
  5.       this.checktobby();
  6.    }
  7.    if(this.procNum == 2)
  8.    {
  9.       this.endCheck();
  10.    }
  11.    if(this.procNum == 3)
  12.    {
  13.       this.passCheck();
  14.    }
  15. }
  16. function checktobby()
  17. {
  18.    var dx = Math.abs(_root.tobbyMC._x - (_root.mapMC._x + this._x));
  19.    if(dx < this.mesXarea && this.outAreaFlg == true)
  20.    {
  21.       this.openMes();
  22.    }
  23.    else
  24.    {
  25.       this.outAreaFlg = true;
  26.    }
  27. }
  28. function openMes()
  29. {
  30.    this.mesMC.gotoAndStop(this.getLabelName());
  31.    this.mesMC._visible = true;
  32.    this.openMesFlg = true;
  33.    this.pCnt = 60;
  34.    this.procNum = 2;
  35. }
  36. function getLabelName()
  37. {
  38.    if(_root.gStageNum == 1)
  39.    {
  40.       var randbase = 0;
  41.    }
  42.    if(_root.gStageNum == 3)
  43.    {
  44.       var randbase = 5;
  45.    }
  46.    if(_root.gStageNum == 6)
  47.    {
  48.       var randbase = 10;
  49.    }
  50.    return this.labelNameList[_root.randomInt(5) - 1 + randbase];
  51. }
  52. function endCheck()
  53. {
  54.    this.pCnt--;
  55.    if(0 >= this.pCnt)
  56.    {
  57.       this.procNum = 3;
  58.       this.mesMC._visible = false;
  59.       this.pCnt = 90;
  60.    }
  61. }
  62. function passCheck()
  63. {
  64.    this.pCnt--;
  65.    if(0 >= this.pCnt)
  66.    {
  67.       this.procNum = 1;
  68.    }
  69. }
  70. this.mesMC._visible = false;
  71. this.outAreaFlg = true;
  72. this.mesXarea = 50;
  73. this.pCnt = 0;
  74. this.procNum = 1;
  75. this.labelNameList = ["a","b","c","d","e","a2","b2","c2","d2","e2","a3","b3","c3","d3","e3"];
  76.